<LayoutTableSmall>

    <!-- 顶部 -->
    <template slot="top"></template>
    <!-- 其他 -->
    <template slot="other"></template>
    <!-- 搜索 -->
    <template slot="search">
        <el-form :inline="true" label-position="left" label-width="80px" :model="mixinTable_tableSearchData"
            @submit.native.prevent class="demo-form-inline">
            <el-form-item>
                <el-input clearable v-model="mixinTable_tableSearchData.activityName" placeholder="请输入活动名称关键字"
                    @change="mixinTable_searchData" style="width:230px">
                    <el-button slot="append" icon="el-icon-search" @click="mixinTable_searchData()"></el-button>
                </el-input>
            </el-form-item>
            <el-form-item>
                <el-select v-model="mixinTable_tableSearchData.activityStatus" @change="mixinTable_searchData"
                    style="width: 100px;" placeholder="活动状态" clearable>
                    <el-option label="未开始" value="1"></el-option>
                    <el-option label="进行中" value="2"></el-option>
                    <el-option label="已结束" value="3"></el-option>
                </el-select>
            </el-form-item>
        </el-form>
    </template>
    <!-- 功能 -->
    <template slot="function">
        <el-button type="primary" @click="editBoxOpen({type:'add'})">新建活动</el-button>
    </template>
    <!-- 表格 -->
    <template slot="table">

        <el-table v-loading="mixinTable_loading"  :data="mixinTable_tableData"  border style="width: 100%;"
            :ref="mixinPage_vueName+'TableSmall'" height="100%"
            @selection-change="mixinTable_handleSelectionChangeTableSmall">
            <el-table-column type="selection" width="50" align="center"></el-table-column>
            <el-table-column type="index" width="50" :index="mixinTable_indexMethod" align="center" label="#">
            </el-table-column>
            <el-table-column prop="activityName" label="活动名称">
            </el-table-column>
            <el-table-column label="活动时间" width="300">
                <template slot-scope="scope">
                    <div>{{scope.row.startTimeStr + " - " + scope.row.endTimeStr}}</div>
                </template>
            </el-table-column>
            <el-table-column prop="activityStatus" label="活动状态">
                <template slot-scope="scope">
                    <div v-if="scope.row.activityStatus == 1" style="color: #ffb025;">未开始</div>
                    <div v-if="scope.row.activityStatus == 2" style="color: #58d44d;">进行中</div>
                    <div v-if="scope.row.activityStatus == 3">已结束</div>
                </template>
            </el-table-column>
            <el-table-column label="操作" align="center" width="340">
                <template slot-scope="scope">
                    <el-button @click="editBoxOpen({type:'update',id:scope.row.id})"
                        v-if="scope.row.activityStatus !== 3 ">编辑活动</el-button>
                    <el-button @click="editBoxOpen({type:'update',id:scope.row.id})"
                        v-if="scope.row.activityStatus === 3 ">查看活动</el-button>


                    <el-button @click="editBoxOpen({type:'copy',id:scope.row.id})">复制</el-button>
                    <el-button type="danger" v-if="scope.row.activityStatus != 2" plain
                        @click="mixinTable_selectTableDeleteData([scope.row])">删除</el-button>
                    <el-button type="danger" v-if="scope.row.activityStatus === 2" plain
                        @click="stopAction([scope.row.id])">停止</el-button>
                </template>
            </el-table-column>
        </el-table>

    </template>
    <!-- 表格选项 -->
    <template slot="options">
        <el-button :disabled="mixinTable_selectTableData.length<=0" @click="batchStopAction()">
            停用已选</el-button>
        <el-button :disabled="mixinTable_selectTableData.length<=0" @click="mixinTable_selectTableDeleteData()">
            删除已选</el-button>
        <el-button :disabled="mixinTable_selectTableData.length<=0"
            @click="mixinTable_clearSelectionChangeTableSmall()">取消选择
        </el-button>
    </template>
    <!-- 分页 -->
    <template slot="page">
        <el-pagination class="paginationStyle" v-if="mixinTable_pageData.total>0" background
            @current-change="mixinTable_pagingData($event)" :current-page="mixinTable_pageData.pageNum"
            :page-size.sync="$vFN.Constants.pageSize" layout="total, prev, pager, next,jumper"
            :total.sync="mixinTable_pageData.total">
        </el-pagination>
    </template>
</LayoutTableSmall>